package com.source.multithread.randomaccesscopyfile;

import java.io.File;
  
  /**
   *
   * @作者 five-five   https://ifeve.com/file-channel/
   * 文件复制完全虽然成功了，但是复制后的文件比原来的文件大了。考虑不周全
   * @创建时间 2020/10/15
   */
 public class TestRandomAccessFile {
     public static void main(String[] args) throws Exception {
         File from=new File("D:\\test-data\\ActiveMQ.pdf"); // 8498338
         File to=new File("D:\\test-data\\to\\"+from.getName());
         DownloadUtil downloadUtil = new DownloadUtil(from,to,8);
         downloadUtil.doDownLoad();

     }
 }